from typing import List, Union, Optional, Dict, Any
from pydantic import BaseModel, Field


class RequestBodyModel(BaseModel):
    url: str


class SuccessResponseModel(BaseModel):
    Status: int = 200
    result: Union[str, List[Any], Dict[str, Any]]


class ErrorResponseModel(BaseModel):
    Status: int = 500
    error: str = "请求失败"


class NewsListModel(BaseModel):
    total_count: Optional[int]
    num_pages: Optional[int]
    data: Union[str, List[Any], Dict[str, Any]]


class ItemModel(BaseModel):
    project: str = Field(None)
    start_time: str = Field(None)
    end_time: str = Field(None)
    keyword: Optional[str] = Field(None)
    pageNum: Optional[int] = 1
    pageSize: Optional[int] = 10
